<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>排行榜</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: "Microsoft Yahei", sans-serif;
            background-color: #f5f5f5;
        }

        .ranking-page {
            max-width: 600px;
            margin: 0 auto;
            background-color: #fff;
        }

        .page-header {
            background-color: #e63946;
            color: #fff;
            padding: 15px;
            text-align: center;
        }

        .page-header h1 {
            font-size: 20px;
            margin-bottom: 10px;
        }

        .tab-nav {
            display: flex;
            justify-content: center;
        }

        .tab-btn {
            background-color: transparent;
            border: none;
            color: #fff;
            padding: 8px 15px;
            margin: 0 5px;
            cursor: pointer;
            font-size: 14px;
        }

        .tab-btn.active {
            background-color: rgba(255, 255, 255, 0.2);
            border-radius: 4px;
        }

        .content-area {
            padding: 15px;
        }

        .article-tab,
        .news-tab {
            display: none;
        }

        .article-tab.active,
        .news-tab.active {
            display: block;
        }

        .article-item {
            margin-bottom: 20px;
            border: 1px solid #eee;
            border-radius: 4px;
            overflow: hidden;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            position: relative;
        }

        .top-badge {
            position: absolute;
            top: 10px;
            left: 10px;
            background-color: #e63946;
            color: #fff;
            font-size: 12px;
            padding: 3px 6px;
            border-radius: 3px;
            z-index: 1;
        }

        .article-img {
            width: 100%;
            height: auto;
            display: block;
        }

        .article-info {
            padding: 10px;
        }

        .article-title {
            font-size: 16px;
            margin-bottom: 8px;
            line-height: 1.5;
        }

        .article-meta {
            font-size: 12px;
            color: #999;
        }

        .view-count,
        .like-count,
        .tag {
            margin-right: 10px;
        }

        .tag {
            background-color: #f1f1f1;
            padding: 2px 6px;
            border-radius: 3px;
        }
    </style>
</head>

<body>
    <div class="ranking-page">
        <header class="page-header">
            <h1>排行榜</h1>
            <nav class="tab-nav">
                <button class="tab-btn active" data-tab="article">好文精选</button>
                <button class="tab-btn" data-tab="news">热门资讯</button>
            </nav>
        </header>
        <main class="content-area">
            <section class="article-tab active" id="article">
                <div class="article-item top1">
                    <div class="top-badge">TOP1</div>
                    <img src="第一.png" alt="安卓电视通过KODI看IPTV" class="article-img">
                    <div class="article-info">
                        <h3 class="article-title">安卓电视通过 KODI 看 IPTV</h3>
                        <div class="article-meta">
                            <span class="view-count">105</span>
                            <span class="like-count">345</span>
                        </div>
                    </div>
                </div>
                <div class="article-item top2">
                    <div class="top-badge">TOP2</div>
                    <img src="第二.webp" alt="起跑线26期：5km跑步" class="article-img">
                    <div class="article-info">
                        <h3 class="article-title">起跑线26期：5km跑步，你到了哪一级别？学会这几个跑步技巧，助你提升PB</h3>
                        <div class="article-meta">
                            <span class="tag">跑者</span>
                            <span class="view-count">151</span>
                            <span class="like-count">132</span>
                        </div>
                    </div>
                </div>
                <div class="article-item top3">
                    <div class="top-badge">TOP3</div>
                    <img src="第三.png" alt="百度相关" class="article-img">
                    <div class="article-info">
                        <h3 class="article-title">百度相关内容</h3>
                        <div class="article-meta">
                            <span class="view-count">99</span>
                            <span class="like-count">201</span>
                        </div>
                    </div>
                </div>
            </section>
            <section class="news-tab" id="news">
                <div class="article-item top1">
                    <div class="top-badge">TOP1</div>
                    <img src="ai.png" alt="最新科技动态" class="article-img">
                    <div class="article-info">
                        <h3 class="article-title">新一代人工智能技术突破，将改变未来生活方式</h3>
                        <div class="article-meta">
                            <span class="tag">科技</span>
                            <span class="view-count">523</span>
                            <span class="like-count">321</span>
                        </div>
                    </div>
                </div>
                <div class="article-item top2">
                    <div class="top-badge">TOP2</div>
                    <img src="运动会.png" alt="体育赛事报道" class="article-img">
                    <div class="article-info">
                        <h3 class="article-title">全国运动会开幕在即，各项赛事准备工作就绪</h3>
                        <div class="article-meta">
                            <span class="tag">体育</span>
                            <span class="view-count">342</span>
                            <span class="like-count">189</span>
                        </div>
                    </div>
                </div>
            </section>
        </main>
    </div>
    <script>
        const tabBtns = document.querySelectorAll('.tab-btn');
        const articleTab = document.getElementById('article');
        const newsTab = document.getElementById('news');

        tabBtns.forEach(btn => {
            btn.addEventListener('click', () => {
                tabBtns.forEach(b => b.classList.remove('active'));
                btn.classList.add('active');

                const tabName = btn.getAttribute('data-tab');
                if (tabName === 'article') {
                    articleTab.classList.add('active');
                    newsTab.classList.remove('active');
                } else if (tabName === 'news') {
                    newsTab.classList.add('active');
                    articleTab.classList.remove('active');
                }
            });
        });
    </script>
</body>

</html>
